﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Reflection;

using ZhimeiSoft.Framework.Common.RefectUtils;
using ZhimeiSoft.CharmManager.Server.DAL.Interface;

namespace ZhimeiSoft.CharmManager.Server.Factory
{
    public class BaseDalFactory
    {
        private static readonly string path = ConfigurationSettings.AppSettings["BusinessDalImpl"];

        private BaseDalFactory() { }

        public static IEmployeeDAL CreateEmployeeDal()
        {
            string className = path + ".EmployeeDAL";
            return (IEmployeeDAL)Assembly.Load(path).CreateInstance(className);
        }

        public static ICustomerDAL CreateCustomerDal()
        {
            string className = path + ".CustomerDAL";
            return (ICustomerDAL)Assembly.Load(path).CreateInstance(className);
        }

        public static IEmployeeVacationDAL CreateEmployeeVacationDal()
        {
            string className = path + ".EmployeeVacationDAL";
            return (IEmployeeVacationDAL)Assembly.Load(path).CreateInstance(className);
        }

        public static ISalonInfoDAL CreateSalonInfoDal()
        {
            string className = path + ".SalonInfoDAL";
            return (ISalonInfoDAL)Assembly.Load(path).CreateInstance(className);
        }

        public static IScheduleDAL CreateScheuleDal()
        {
            string className = path + ".ScheuleDAL";
            return (IScheduleDAL)Assembly.Load(path).CreateInstance(className);
        }
        
    }
}
